//
//  FDDatePickView.m
//  FD
//
//  Created by xiaofang wang on 2018/11/6.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//  小时 分钟日期选择器

#import "FDDatePickView.h"
#import "BRPickerViewMacro.h"

@interface FDDatePickView()<UIPickerViewDelegate,UIPickerViewDataSource>
{
    //记录 时 分 当前选择的位置
    NSInteger _hourIndex;
    NSInteger _minuteIndex;
    
    BOOL _isAutoSelect; //是否开启自动选择
}
/**时间选择器1*/
@property (nonatomic, strong) UIDatePicker *datePicker;
/**时间选择器2 */
@property (nonatomic, strong) UIPickerView *pickerView;
/**日期存储数组*/
@property (nonatomic, strong) NSArray *hourArr;
@property (nonatomic, strong) NSArray *minuteArr;

/**限制最小日期*/
@property (nonatomic, strong) NSDate *minLimitDate;
/**限制最大日期*/
@property (nonatomic, strong) NSDate *maxLimitDate;
/**当前选择的日期*/
@property (nonatomic, strong) NSDate *selectDate;
/**选择的日期格式*/
@property (nonatomic, copy) NSString *selectDateFormate;

/**选中后的回调*/
@property (nonatomic, copy) FDDateResultBlock resultBlock;
/**取消选中后的回调*/
@property (nonatomic, copy) FDDateCancelBlock cancelBlock;


@end

@implementation FDDatePickView
#pragma mark - 时间选择器2
- (UIPickerView *)pickerView {
    if (!_pickerView) {
        _pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, kTopViewHeight + 0.5, self.alertView.frame.size.width, kPickerHeight)];
        _pickerView.backgroundColor = [UIColor whiteColor];
        //设置子视图的大小随着父试图变化
        _pickerView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;
        //设置代理
        _pickerView.dataSource = self;
        _pickerView.delegate = self;
        _pickerView.showsSelectionIndicator = YES;
    }
    return _pickerView;
}

#pragma mark - UIPickerViewDataSource
//- numbero
//#pragma mark - UIPickerViewDelegate

@end
